package cn.classyex.business.hr.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.classyex.business.hr.mapper.EmployeeTrainMapper;
import cn.classyex.business.hr.domain.EmployeeTrain;
import cn.classyex.business.hr.service.IEmployeeTrainService;
import com.ruoyi.common.core.text.Convert;

/**
 * 员工培训管理Service业务层处理
 * 
 * @author yex
 * @date 2021-05-06
 */
@Service
public class EmployeeTrainServiceImpl implements IEmployeeTrainService 
{
    @Autowired
    private EmployeeTrainMapper employeeTrainMapper;

    /**
     * 查询员工培训管理
     * 
     * @param employeeTrainId 员工培训管理ID
     * @return 员工培训管理
     */
    @Override
    public EmployeeTrain selectEmployeeTrainById(Long employeeTrainId)
    {
        return employeeTrainMapper.selectEmployeeTrainById(employeeTrainId);
    }

    /**
     * 查询员工培训管理列表
     * 
     * @param employeeTrain 员工培训管理
     * @return 员工培训管理
     */
    @Override
    public List<EmployeeTrain> selectEmployeeTrainList(EmployeeTrain employeeTrain)
    {
        return employeeTrainMapper.selectEmployeeTrainList(employeeTrain);
    }

    /**
     * 新增员工培训管理
     * 
     * @param employeeTrain 员工培训管理
     * @return 结果
     */
    @Override
    public int insertEmployeeTrain(EmployeeTrain employeeTrain)
    {
        employeeTrain.setCreateTime(DateUtils.getNowDate());
        return employeeTrainMapper.insertEmployeeTrain(employeeTrain);
    }

    /**
     * 修改员工培训管理
     * 
     * @param employeeTrain 员工培训管理
     * @return 结果
     */
    @Override
    public int updateEmployeeTrain(EmployeeTrain employeeTrain)
    {
        employeeTrain.setUpdateTime(DateUtils.getNowDate());
        return employeeTrainMapper.updateEmployeeTrain(employeeTrain);
    }

    /**
     * 删除员工培训管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteEmployeeTrainByIds(String ids)
    {
        return employeeTrainMapper.deleteEmployeeTrainByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除员工培训管理信息
     * 
     * @param employeeTrainId 员工培训管理ID
     * @return 结果
     */
    @Override
    public int deleteEmployeeTrainById(Long employeeTrainId)
    {
        return employeeTrainMapper.deleteEmployeeTrainById(employeeTrainId);
    }
}
